env:
  - GO111MODULE=on
before:
  hooks:
    - go mod download
builds:
  - id: "x64"
    binary: dirstat
    ldflags: -s -w -X github.com/aegoroff/dirstat/internal/cmd.Version={{ .Version }}
    goos:
      - linux
      - freebsd
      - windows
      - darwin
    goarch:
      - amd64

  - id: "386"
    binary: dirstat
    ldflags: -s -w -X github.com/aegoroff/dirstat/internal/cmd.Version={{ .Version }}
    goos:
      - linux
      - windows
      - freebsd
    goarch:
      - 386

  - id: "arm"
    binary: dirstat
    ldflags: -s -w -X github.com/aegoroff/dirstat/internal/cmd.Version={{ .Version }}
    goos:
      - linux
      - freebsd
    goarch:
      - arm
    goarm:
      - 7

  - id: "arm64"
    binary: dirstat
    ldflags: -s -w -X github.com/aegoroff/dirstat/internal/cmd.Version={{ .Version }}
    goos:
      - linux
      - freebsd
      - darwin
    goarch:
      - arm64


archives:
  - id: default
    builds:
      - x64
      - arm
      - arm64
      - 386

brews:
-
    goarm: 7
    tap:
      owner: aegoroff
      name: homebrew-tap
    commit_author:
      name: "Alexander Egorov"
      email: "egoroff@gmail.com"
    test: |
      assert_match version.to_s, shell_output("#{bin}/dirstat ver")
    homepage: "https://github.com/aegoroff/dirstat"
    description: "Small tool that shows selected folder or drive (on Windows) usage statistic"
    license: "Apache-2.0"

scoop:
  bucket:
    owner: aegoroff
    name: scoop-bucket
  homepage:  https://github.com/aegoroff/dirstat
  description: Small tool that shows selected folder or drive (on Windows) usage statistic
  license: Apache-2.0

nfpms:
  -
    package_name: dirstat
    homepage: https://github.com/aegoroff/dirstat
    maintainer: Alexander Egorov <egoroff@gmail.com>
    description: Small tool that shows selected folder or drive (on Windows) usage statistic
    license: MIT
    bindir: /usr/bin
    formats:
      - deb
      - rpm

signs:
  - artifacts: checksum
    args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]

checksum:
  name_template: "checksums.txt"
snapshot:
  name_template: "{{ .Tag }}"
